/* motion-control.css */

.motion-panel {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 320px;
    flex-shrink: 0;
}

.panel-content {
    display: flex;
    gap: 2px;
    align-items: center; /* 确保方向盘垂直居中 */
}

.module-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    min-width: 2.5rem; /* 确保标题有固定宽度 */
    margin: 0; /* 移除之前的底部间距 */
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

/* 方向控制盘 - PS5风格 */
.direction-pad {
    margin-right: 1px;
    margin-left: 8px;
    position: relative;
    width: 90px;
    height: 90px;
    background: #e5e7eb;
    border-radius: 50%;  /* 改为圆形 */
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    padding: 6px;
}

/* 方向按钮基础样式 */
.direction-button {
    position: absolute;
    width: 28px;
    height: 28px;
    background: #f1f5f9;  /* 按钮浅色背景 */
    border: none;
    border-radius: 6px;
    color: #64748b;  /* 图标颜色 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* 方向按钮位置调整 */
.direction-button.forward {
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.direction-button.backward {
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.direction-button.left {
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.direction-button.right {
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* 悬停和激活状态 */
.direction-button:hover {
    background: #6626bb;
    color: white;
    box-shadow:
        0 2px 4px rgba(37, 99, 235, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.direction-button:active {
    background: #1d4ed8;
    transform: scale(0.95) translateX(-50%);  /* 保持位置的同时添加缩放 */
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 保持停止按钮的原有样式 */
.stop-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: #9768d5;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 1;  /* 确保停止按钮在最上层 */
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.stop-button:hover {
    background: #cb6767;
}

.stop-button:active {
    background: #b91c1c;
    transform: translate(-50%, -50%) scale(0.95);
}

/* 图标样式 */
.direction-button i,
.stop-button i {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

/* 按钮激活状态的特殊处理 */
.direction-button.left:active {
    transform: scale(0.95) translateY(-50%);
}

.direction-button.right:active {
    transform: scale(0.95) translateY(-50%);
}

.direction-button.forward:active {
    transform: scale(0.95) translateX(-50%);
}

.direction-button.backward:active {
    transform: scale(0.95) translateX(-50%);
}

/* 参数区域 */
.params-section {
    flex-grow: 1;
    max-width: 400px; /* 限制最大宽度 */
}

.section-block {
    margin-bottom: 16px;
}

/* 速度参数设置 */
.params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.param-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.param-label {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 40px;
    font-size: 12px;
    color: #374151;
}

.param-label i {
    width: 16px;
    height: 16px;
    color: #3b82f6;
}

.param-input {
    width: 35px;
    height: 20px;
    padding: 0 4px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 13px;
    color: #3b82f6;
    text-align: right;
}

.param-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.param-unit {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.wheel-params {
    padding-top: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.wheel-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);  /* 或者使用 1fr 1fr */
    gap: 16px;  /* 控制左右轮之间的间距 */
}

.control-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 24px;

}

/* 编码器垂直列表 */
.encoder-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    width: 180px;
}

.encoder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 4px;
    min-width: 120px;  /* 保证宽度足够 */
}

.encoder-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-size: 13px;
}

.encoder-value {
    color: #3b82f6;
    font-size: 14px;
    min-width: 32px;
    text-align: right;
}